package cn.edu.nju.ws.aquila.rdf.canonicalization.comparator;

import java.util.Comparator;

/**
 * @author Gong Cheng
 * 
 */
public class StringComparator implements Comparator<String> {
	public int compare(String s1, String s2) {
		if (s1 == null && s2 == null) {
			return 0;
		}

		if (s1 == null && s2 != null) {
			return -1;
		}

		if (s1 != null && s2 == null) {
			return 1;
		}

		return s1.compareTo(s2);
	}

	public void close() {
		/* Nothing */
	}
}